package com.ruoyi.common.cyzUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CardNoUtil {

    private final static String PREFIX = "NO: ";
    private static long code;

    public static synchronized String getOrderCode() {
        code++;
        String str = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
        long m = Long.parseLong((str.substring(8)));
        m += code;
        return PREFIX + m;
    }

    public static void main(String[] args) {
        System.out.println(CardNoUtil.getOrderCode());
    }

}
